package com.example.lab.service;

import com.example.lab.entity.Role;
import com.example.lab.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 用户基础信息表 服务类
 * </p>
 *
 * @author 布莱恩
 * @since 2025-06-15
 */
public interface IUserService extends IService<User> {

    User getUserByUsername(String username);

    List<Role> getUserRoles(Integer userId);

    boolean removeUserRoles(Integer userId);

    User getUserWithRolesAndPermissions(String username);

    boolean assignRolesToUser(Integer userId, List<Integer> roleIds);

    boolean hasPermission(Integer userId, String permissionCode);

}
